home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / expect-5.16 / README < prev   
Encoding:
Text File  |  1995-07-14  |  17.6 KB  |  416 lines

  1. --------------------
  2. Introduction
  3. --------------------
  4.  
  5. This is the README file for Expect, a program that performs programmed
  6. dialogue with other interactive programs.  It is briefly described by
  7. its man page, expect(1).  This directory contains the source and
  8. documentation for Expect.
  9.  
  10. This is Expect 5 for Tcl 7.0 thru 7.4.  Tk 3.3 thru 3.6 are also
  11. supported.  If you have Expect 4 scripts, read the CHANGES.4to5 file.
  12.  
  13. --------------------
  14. Getting Started - The Preferable Way
  15. --------------------
  16.  
  17. A book on Expect is available from O'Reilly with the title "Exploring
  18. Expect: A Tcl-Based Toolkit for Automating Interactive Applications",
  19. ISBN 1-56592-090-2.
  20.  
  21. The book is filled with detailed examples and explanations, and is a
  22. comprehensive tutorial to Expect.  The book also includes a tutorial
  23. on Tcl written specifically for Expect users (so you don't have to
  24. read the Expect papers, the debugger paper, Ousterhout's book, or the
  25. man pages).  Exploring Expect is 602 pages.
  26.  
  27. If you have access to World Wide Web, here are some related URLs:
  28.  
  29. one-paragraph description (from O'Reilly catalog):
  30.     http://nearnet.gnn.com/gnn/bus/ora/item/expect.html
  31. one-page description (from back cover of book):
  32.     http://nearnet.gnn.com/gnn/bus/ora/item/expect.desc.html
  33. front cover - picture and description:
  34.     http://nearnet.gnn.com/gnn/bus/ora/item/expect.cover.html
  35.  
  36. To order:
  37.     Via email: order@ora.com
  38.     Via the web: http://nearnet.gnn.com/gnn/bus/ora/ordering/index.html
  39.     Via phone (Weekdays 6am-6pm PST): 800-889-9938 or 707-829-0515
  40.  
  41. Publisher's address: O'Reilly & Associates, Inc.
  42.                  103A Morris Street
  43.                  Sebastopol, CA  95472
  44.  
  45.  
  46. O'Reilly also has available very pretty t-shirts with a blown-up
  47. picture of the artwork from the front cover.
  48.  
  49. --------------------
  50. Getting Started - The Hacker Way
  51. --------------------
  52.  
  53. While the book is the best way to learn about Expect, it is not
  54. absolutely necessary.  There are man pages after all, plus I have
  55. published numerous papers on Expect.  All of these papers are in the
  56. public domain and can be received free.  If you are a hacker on a
  57. tight budget, this may appeal to you.  Nonetheless, I think you will
  58. find the book pays for itself very quickly.  It is much more readable
  59. than the man pages, it includes well-written and explained examples,
  60. and it describes everything in the papers as a coherent whole.  The
  61. concepts in the papers actually only make up a small fraction of the
  62. book.
  63.  
  64. The 1990 USENIX paper (see "Readings" below) is probably the best one
  65. for understanding Expect conceptually.  The 1991 Computing Systems and
  66. the LISA IV papers provide a nice mix of examples.  The only downside
  67. is, the examples in these papers don't actually work anymore - some
  68. aspects (e.g., syntax) of both Expect and Tcl have changed.  The
  69. papers still make interesting reading - just don't study the examples
  70. too closely!  Fortunately, most of the examples from the papers also
  71. accompany this distribution - and all of these are up to date.
  72.  
  73. For all the details, read the man page.  It is long but you can get
  74. started just by skimming the sections on the following commands:
  75.  
  76.     spawn        (starts a process)
  77.     send        (sends to a process)
  78.     expect        (waits for output from a process)
  79.     interact    (lets you interact with a process)
  80.  
  81. To print out the Expect man page, invoke your local troff using the
  82. -man macros, such as either of:
  83.  
  84.         ptroff -man expect.man
  85.         ditroff -man expect.man
  86.  
  87. If Expect is installed, you can read the man pages using the "usual"
  88. man commands, such as "man expect".  If not installed, view the man
  89. page on your screen by saying something like:
  90.  
  91.         nroff -man expect.man | more
  92.  
  93. Expect uses Tcl as the underlying language for expressing things such
  94. as procedures, loops, file I/O, and arithmetic expressions.  For many
  95. simple scripts, it is not necessary to learn about Tcl.  Just by
  96. studying the examples, you will learn enough Tcl to get by.  But if
  97. you would like to learn more about Tcl or use it in your own
  98. applications, read the Tcl README file which provides pointers to the
  99. extensive Tcl documentation.  Or read Exploring Expect.  Chapter 2 of
  100. Exploring Expect is a Tcl tutorial specifically designed for Expect
  101. users.
  102.  
  103. An interactive debugger is bundled with Expect.  The debugger has its
  104. own documentation that comes separately.  It is listed in the Readings
  105. below.  Again, it is slightly out of date.  An up-to-date description
  106. of the debugger appears in Chapter 18 of Exploring Expect.  This
  107. chapter also contains additional advice and tips for debugging.
  108.  
  109. You may get the feeling that the Expect documentation is somewhat
  110. scattered and disorganized.  This was true prior to publication of
  111. Exploring Expect.  The book contains everything you need to know, all
  112. up-to-date, and with examples of every concept.  (The book contains no
  113. references to any of the Expect papers because none are necessary.)
  114.  
  115. ----------------------
  116. Examples
  117. ----------------------
  118.  
  119. This distribution contains many example scripts.  (All of the
  120. substantive examples in the book are included.)  They can be found in
  121. the example directory of this distribution.  The README file in that
  122. directory briefly describes all of the example scripts.  Many of the
  123. more sophisticated examples have man pages of their own.
  124.  
  125. Other interesting scripts are available separately in the directory
  126. pub/expect/scripts at ftp.cme.nist.gov.  (See below for how to
  127. retrieve these.)  You are welcome to send me scripts to add to this
  128. directory.  A number of Expect scripts are also available in the Tcl
  129. archive, available via anonymous ftp at ftp.aud.alcatel.com.
  130.  
  131. --------------------
  132. Readings on Expect
  133. --------------------
  134.  
  135. The implementation, philosophy, and design are discussed in "expect:
  136. Curing Those Uncontrollable Fits of Interaction", Proceedings of the
  137. Summer 1990 USENIX Conference, Anaheim, CA, June 11-15, 1990.
  138.  
  139. Examples and discussion, specifically aimed at system administrators,
  140. are in "Using expect to Automate System Administration Tasks",
  141. Proceedings of the 1990 USENIX Large Systems Administration Conference
  142. (LISA) IV, Colorado Springs, CO, October 17-19, 1990.
  143.  
  144. A comprehensive paper of example scripts is "expect: Scripts for
  145. Controlling Interactive Programs", Computing Systems, Vol. 4, No. 2,
  146. University of California Press Journals, 1991.
  147.  
  148. Regression and conformance testing is discussed in "Regression Testing
  149. and Conformance Testing Interactive Programs", Proceedings of the
  150. Summer 1992 USENIX Conference, San Antonio, TX, June 8-12, 1992.
  151.  
  152. An explanation of some of the more interesting source code to an early
  153. version of Expect is in Chapter 36 ("Expect") of "Obfuscated C and
  154. Other Mysteries", John Wiley & Sons, ISBN 0-471-57805-3, January 1993.
  155.  
  156. A paper on connecting multiple interactive programs together using
  157. Expect is "Kibitz - Connecting Multiple Interactive Programs
  158. Together", Software - Practice & Experience, Vol. 23, No. 5, May 1993.
  159.  
  160. The debugger is discussed in "A Debugger for Tcl Applications",
  161. Proceedings of the 1993 Tcl/Tk Workshop, Berkeley, CA, June 10-11,
  162. 1993.
  163.  
  164. Using Expect with Tk is described in the paper "X Wrappers for
  165. Non-Graphic Interactive Programs", Proceedings of Xhibition '94, San
  166. Jose, CA, June 20-24, 1994.
  167.  
  168. Simple techniques to allow secure handling of passwords in background
  169. processes are covered in "Handling Passwords with Security and
  170. Reliability in Background Processes", Proceedings of the 1994 USENIX
  171. LISA VIII Conference, San Diego, CA, September 19-23, 1994.
  172.  
  173. --------------------
  174. How to Get the Latest Version of Expect or the Readings
  175. --------------------
  176.  
  177. Expect may be ftp'd as pub/expect/expect.tar.Z from ftp.cme.nist.gov.
  178. Request email delivery by mailing to "library@cme.nist.gov".  The
  179. contents of the message should be (no subject line) "send
  180. pub/expect/expect.tar.Z".  (Development versions of Expect may
  181. occasionally be made available as alpha.tar.Z in the same directory.)
  182.  
  183. Once you have retrieved the system, read the INSTALL file.  The papers
  184. mentioned above can be retrieved separately as:
  185.  
  186.   pub/expect/seminal.ps.Z            (USENIX '90 - Intro and Implementation)
  187.   pub/expect/sysadm.ps.Z               (LISA '90 - System Administration)
  188.   pub/expect/scripts.ps.Z (Computing Systems '91 - Overview of Scripts)
  189.   pub/expect/regress.ps.Z            (USENIX '92 - Testing)
  190.   pub/expect/kibitz.ps.Z               (SP&E '93 - Automating Multiple
  191.                     Interactive Programs Simultaneously)
  192.   pub/expect/tcl-debug.ps.Z          (Tcl/Tk '93 - Tcl/Tk Debugger)
  193.   pub/expect/expectk.ps.Z         (Xhibition '94 - Using Expect with Tk)
  194.   pub/expect/bgpasswd.ps.Z             (LISA '94 - Passwds in Background Procs)
  195.  
  196. The book "Exploring Expect" is described in more detail earlier in
  197. this file.
  198.  
  199. The book "Obfuscated C and Other Mysteries" is not on-line but is
  200. available in bookstores or directly from the publisher (Wiley).
  201.  
  202. Overhead transparencies I've used at conferences are also available in
  203. the same way as the papers themselves.  The transparencies are sketchy
  204. and not meant for personal education - however if you are familiar
  205. with Expect and just want to give a short talk on it to your
  206. colleagues, you may find the transparencies useful.  They vary in
  207. length from 15 to 20 minutes in length.  These are:
  208.  
  209.   pub/expect/seminal-talk.ps.Z    (USENIX '90 - Intro and Implementation)
  210.   pub/expect/sysadm-talk.ps.Z       (LISA '90 - System Administration)
  211.   pub/expect/regress-talk.ps.Z    (USENIX '92 - Testing)
  212.   pub/expect/tcl-debug-talk.ps.Z  (Tcl/Tk '93 - Tcl/Tk Debugger)
  213.   pub/expect/expectk-talk.ps.Z (Xhibition '94 - Expect + Tk = Expectk)
  214.   pub/expect/bgpasswd-talk.ps.Z     (LISA '94 - Passwords in the Background)
  215.  
  216. All of the documents are compressed PostScript files and should be
  217. uncompressed and sent to a PostScript printer.  The documents are
  218. intended for printing at 8.5"x11" and may fail on some ISO A4
  219. printers.  According to Hans Mayer <Hans.Mayer@gmd.de>, you can make
  220. them A4-able by searching for "FMVERSION" and changing the next line
  221. from:
  222.  
  223.     1 1 0 0 612 792 0 1 13 FMDOCUMENT
  224. to:
  225.     1 1 0 0 594 841 0 1 13 FMDOCUMENT
  226.  
  227.  
  228. --------------------
  229. Using Expect with and without Tcl and/or Tk.
  230. --------------------
  231.  
  232. The usual way of using Expect is as a standalone program with Tcl as
  233. the control language.  Since you may already have Tcl, it is available
  234. separately.  Tcl may be retrieved as pub/expect/tcl.tar.Z in the same
  235. way as described above for Expect.  When new releases of Tcl appear, I
  236. will try to check them out for Expect as soon as possible.  If you
  237. would like to get the newest Tcl release without waiting, ftp it from
  238. ftp.cs.berkeley.edu (directory: ucb/tcl).
  239.  
  240. Expect may also be built using the Tk library, a Tcl interface to the
  241. X Window System.  Tk is available in the same way as Tcl.
  242.  
  243. It is possible to embed the Expect/Tcl core and optionally Tk in your
  244. own C programs.  This is described in libexpect(3).
  245.  
  246. Expect can also be used from a C or C++ program without Tcl.  This is
  247. described in libexpect(3).  While I consider this library to be easy
  248. to use, the standalone Expect program is much, much easier to use than
  249. working with the C compiler and its usual edit, compile, debug cycle.
  250. Unlike typical programming, most of the debugging isn't getting the C
  251. compiler to accept your programs - rather, it is getting the dialogue
  252. correct.  Also, translating scripts from Expect to C is usually not
  253. necessary.  For example, the speed of interactive dialogues is
  254. virtually never an issue.  So please try 'expect' first.  It is a more
  255. appropriate tool than the library for most people.
  256.  
  257. --------------------
  258. Systems Supported
  259. --------------------
  260.  
  261. I do not know of any UNIX systems on which Expect will not run.
  262. Systems which do not support select or poll can use Expect, but
  263. without the ability to run multiple processes simultaneously.  I am
  264. willing to work with you to complete a port.
  265.  
  266. Before sending me changes, please download or verify that you have the
  267. latest version of Expect (see above).  Then send me a "diff -c" along
  268. with a suitable English explanation.  If your diff involves something
  269. specific to a machine, give me diffs for configure.in as well or give
  270. me a hint about when the diffs should be done so I can write the
  271. configure support myself.  Also please include the version of the OS
  272. and whether it is beta, current, recent, or totally out-of-date and
  273. unsupported.
  274.  
  275. --------------------
  276. Installing Expect
  277. --------------------
  278.  
  279. Expect comes with a configure script that provides for an automated
  280. installation.  I believe you will find that Expect is very easy to
  281. install.  (Tcl and Tk, too.)
  282.  
  283. For more information, read the INSTALL file.
  284.  
  285. --------------------
  286. History
  287. --------------------
  288.  
  289. Expect was conceived of in September, 1987.  The bulk of version 2 was
  290. designed and written between January and April, 1990.  Minor evolution
  291. occurred after that until Tcl 6.0 was released.  At that time
  292. (October, 1991) approximately half of Expect was rewritten for version
  293. 3.  See the HISTORY file for more information.  The HISTORY file may
  294. be retrieved separately as pub/expect/HISTORY.
  295.  
  296. Around January 1993, an alpha version of Expect 4 was introduced.
  297. This included Tk support as well as a large number of enhancements.  A
  298. few changes were made to the user interface itself, which is why the
  299. major version number was changed.  A production version of Expect 4
  300. was released in August 1993.
  301.  
  302. In October 1993, an alpha version of Expect 5 was released to match
  303. Tcl 7.0.  A large number of enhancements were made, including some
  304. changes to the user interface itself, which is why the major version
  305. number was changed (again).  This documentation and software
  306. distribution is the production version of Expect 5 - initially
  307. released in March '94.  
  308.  
  309. Some of the papers listed above correspond to earlier versions
  310. although they are still good ways to learn about Expect.  There are
  311. important differences between Expect 3, 4, and 5.  See the CHANGES.*
  312. files if you want to read about them.  Expect 4 has ceased further
  313. development and is not supported.  However, if for some reason you
  314. want the old code, it is available from pub/expect/old as described
  315. above.
  316.  
  317. The book became available around January '95.  It describes Expect 5
  318. as it is today, rather than how Expect 5 was when it was originally
  319. released.  Thus, if you have not upgraded Expect since before getting
  320. the book, you should upgrade now.
  321.  
  322. --------------------
  323. Support from Don Libes or NIST
  324. --------------------
  325.  
  326. Although I can't promise anything in the way of support, I'd be
  327. interested to hear about your experiences using it (good or bad).  I'm
  328. also interested in hearing bug reports and suggestions for improvement
  329. even though I can't promise to implement them.
  330.  
  331. If you send me a bug, fix, or question, include the version of Expect
  332. (as reported by expect -d), version of Tcl, and name and version of
  333. the OS that you are using.  Before sending mail, it may be helpful to
  334. verify that your problem still exists in the latest version.  You can
  335. check on the current release and whether it addresses your problems by
  336. retrieving the latest HISTORY file (see "History" above).
  337.  
  338.  
  339. Awards, love letters, and bug reports may be sent to:
  340.  
  341. Don Libes
  342. National Institute of Standards and Technology
  343. Bldg 220, Rm A-127
  344. Gaithersburg, MD  20899
  345. (301) 975-3535
  346. libes@nist.gov
  347.  
  348. I hereby place this software in the public domain.  NIST and I would
  349. appreciate credit if this program or parts of it are used.
  350.  
  351. Design and implementation of this program was funded primarily by
  352. myself.  Funding contributors include the NIST Automated Manufacturing
  353. Research Facility (funded by the Navy Manufacturing Technology
  354. Program), the NIST Scientific and Technical Research Services, the
  355. ARPA Persistent Object Bases project and the Computer-aided
  356. Acquisition and the Logistic Support (CALS) program of the Office of
  357. the Secretary of Defense.
  358.  
  359. Especially signicant contributions were made by John Ousterhout, Henry
  360. Spencer, and Rob Savoye.  See the HISTORY file for others.
  361.  
  362. --------------------
  363. Support for Don Libes or NIST
  364. --------------------
  365.  
  366. NIST accepts external funding and other resources (hardware, software,
  367. and personnel).  This can be a fine way to work more closely with NIST
  368. and encourage particular areas of research.
  369.  
  370. Funding can be earmarked for specific purposes or for less-specific
  371. purposes.  For example, if you simply like the work I do, you can
  372. contribute directly to my funding which will reduce the amount of time
  373. I have to spend writing proposals and submitting them to other people
  374. for funding on my own.
  375.  
  376. I can also participate in the NIST Fellows program allowing me to
  377. spend several months to a year working directly with your company and
  378. potentially even at your location.  I am also interested in returning
  379. to an academic program.  I presently have an MS and am hunting for
  380. Ph.D. topics and advisors.  Let me know if you have ideas or are
  381. interested in being my advisor.
  382.  
  383. --------------------
  384. Commercial Support 
  385. --------------------
  386.  
  387. Several companies provide commercial support for Expect.  If your
  388. company has a financial investment in Expect or you wish to be assured
  389. of continuing support for Expect, you can buy a support contract this
  390. way.  These companies currently include:
  391.  
  392. Cygnus Support
  393. 1937 Landings Drive
  394. Mountain View, CA  94043
  395. +1 (415) 903-1400
  396. info@cygnus.com
  397.  
  398. Computerized Processes Unlimited
  399. 4200 S. I-10 Service Rd., Suite 205
  400. Metairie, LA  70006
  401. +1 (504) 889-2784
  402. info@cpu.com
  403.  
  404. Neither NIST nor I have any commercial relationship with these
  405. companies.  Cygnus is in the process of signing an agreement with NIST
  406. that describes its non-exclusive position to support Expect.  Other
  407. companies are welcome to apply for such an agreement or other kinds of
  408. agreements such as permission-to-use.  Strictly speaking, such
  409. agreements are not necessary, however they make us look good to our
  410. funding source, the U.S. Congress.
  411.  
  412. Note that Cygnus does not sell support for Expect explicitly.  But
  413. they will support Expect if you buy support for their DejaGnu product
  414. which is a testing framework built on top of Expect.
  415.  
  416.